package com.qf.personal.controller;


import com.qf.common.base.result.RespResult;
import com.qf.personal.entiy.Report;
import com.qf.personal.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Api(tags = "报告")
@RestController
@RequestMapping("/my/report")
public class ReportController {

    @Resource
    private ReportService reportService;

    @PutMapping("/add")
    @ApiOperation("新增报告")
    @ApiResponses({@ApiResponse(code = 200, message = "成功")})
    public RespResult<String> add(Report report) {
        return reportService.add(report);
    }

    @PutMapping("/delete")
    @ApiOperation("删除")
    @ApiResponses({@ApiResponse(code = 200, message = "成功")})
    public RespResult<String> delete(Long id) {
        return reportService.deleteById(id);
    }

}
